<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cpp-ipfs-http-client: IPFS C++ HTTP API client library</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cpp-ipfs-http-client
   </div>
   <div id="projectbrief">IPFS C++ client library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div><div class="header">
  <div class="headertitle"><div class="title">IPFS C++ HTTP API client library </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="anchor" id="md__2media_2melroy_2Data_2Projects_2cpp-ipfs-http-client_2doxygen__mainpage"></a> The main class the library exports is <a class="el" href="classipfs_1_1Client.html">ipfs::Client</a>. The rest is only interesting to developers of this library.</p>
<h1>Build &amp; Install</h1>
<div class="fragment"><div class="line"># Fetch the source code from GitHub.</div>
<div class="line">git clone git@github.com:vasild/cpp-ipfs-http-client.git</div>
<div class="line">cd cpp-ipfs-http-client</div>
<div class="line"> </div>
<div class="line"># Build the library inside a seperate build directory.</div>
<div class="line"># Note: This is a shared build, you can Omit BUILD_SHARED_LIBS for static builds.</div>
<div class="line">#</div>
<div class="line"># These extra options may be of interest in case the dependencies have</div>
<div class="line"># been installed in non-standard locations:</div>
<div class="line"># CURL_INCLUDE_DIR</div>
<div class="line"># CURL_LIBRARY</div>
<div class="line">mkdir build</div>
<div class="line">cd build</div>
<div class="line">cmake \</div>
<div class="line">  -DCMAKE_INSTALL_PREFIX:PATH=/home/joe.smith/cpp-ipfs-http-client-install \</div>
<div class="line">  -DCURL_INCLUDE_DIR:PATH=/home/joe.smith/include</div>
<div class="line">  -DCURL_LIBRARY:PATH=/home/joe.smith/lib/libcurl.so</div>
<div class="line">  -DCMAKE_BUILD_TYPE=Debug \</div>
<div class="line">  -DBUILD_SHARED_LIBS:BOOL=ON \</div>
<div class="line">  -DBUILD_TESTING:BOOL=OFF \</div>
<div class="line">  ..</div>
<div class="line">make -j 8</div>
<div class="line"> </div>
<div class="line"># Optionally install it.</div>
<div class="line">make install</div>
</div><!-- fragment --><p><em>Hint:</em> Use <code>cmake -LAH</code> to list all available options.</p>
<p><em>Note:</em> Omitting <code>DBUILD_SHARED_LIBS</code> above is fine as well, if you want to statically link this library into your project.</p>
<h1>Build via C++ compiler</h1>
<div class="fragment"><div class="line">g++ -std=c++11 -I/path/to/header -L/path/to/lib -lipfs-http-client myprog.cc -o myprog</div>
</div><!-- fragment --><h1>Install &amp; Build using existing CMake project</h1>
<p>Use the C++ IPFS Client inside an existing CMake project. We add the IPFS client inside the <code>lib</code> folder. <br  />
 For example via <code>git submodule</code> (but <code>git clone</code> should also work):</p>
<div class="fragment"><div class="line">cd your-cmake-project</div>
<div class="line">git submodule add https://github.com/vasild/cpp-ipfs-http-client.git lib/ipfs-http-client</div>
</div><!-- fragment --><p>Edit your <code>CMakeLists.txt</code> file to include the C++ IPFS HTTP Client in your build:</p>
<div class="fragment"><div class="line">add_subdirectory (lib/ipfs-http-client)</div>
</div><!-- fragment --><p>Finally, add the C++ IPFS HTTP static library to your target using <code>target_link_libraries()</code> <br  />
 (in this example <code>${PROJECT_TARGET}</code> variable is used as target name):</p>
<div class="fragment"><div class="line">set(PROJECT_TARGET my-app)</div>
<div class="line"> </div>
<div class="line">target_link_libraries(${PROJECT_TARGET} PRIVATE ipfs-http-client)</div>
</div><!-- fragment --><h1>Dependencies</h1>
<ul>
<li><a href="https://github.com/nlohmann/json#supported-compilers">C++11 compiler</a> (nlohmann json project is fetched automatically by CMake)</li>
<li><a href="http://cmake.org">CMake</a>, version 3.11.0 or higher</li>
<li><a href="https://curl.haxx.se/libcurl">libcurl</a>, version 7.25.0 or higher</li>
</ul>
<p>Optionally (for generation this documentation you're reading):</p>
<ul>
<li><a href="https://www.doxygen.nl">Doxygen</a>, version 1.9.0 or higher</li>
</ul>
<h1>License</h1>
<p>The code is distributed under the <a href="http://opensource.org/licenses/MIT">MIT License</a>. </p>
</div></div><!-- PageDoc -->
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7
</small></address>
</body>
</html>
